export const useLocaLityChildren = (name: string) => {
  console.log(name, 'name');

  let children = ref<any>([]);
  let childrenNames = ref<any>([]);

  /**
   * @description: 清空数组
   * @return {*}
   */
  const clearChildren = () => {
    children.value.length = 0;
    childrenNames.value.length = 0;
  };

  const adChildren = (item: any) => {
    const value = item[name];
    if (value && !childrenNames.value.includes(value)) {
      childrenNames.value.push(value);
      children.value.push({
        label: value,
        value
      });
    }
  };
  return { children, childrenNames, clearChildren, adChildren };
};
